/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo6 {
    private boolean isFalse = false;
    public void text() throws InterruptedException {
        Thread thread =new Thread(()->{
            while(!isFalse){
                System.out.println("thread线程");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        thread.start();
        Thread.sleep(3000);
        isFalse=true;
    }

    public static void main(String[] args) {
        Demo6 text =new Demo6();
        try {
            text.text();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
